1. Field of the Disclosure
The present disclosure relates generally to a method and electronic device for converting a color of an image, and more particularly, to a method and electronic device for converting a color of an image based on information corresponding to a portion of the image displayed on a display.
2. Description of the Related Art In an electronic device, such as a smartphone, a tablet personal computer (PC) or a personal digital assistant (PDA), color design for a user interface (UI) is an important factor for maximizing aesthetics and usability for the user. Further, since the colors that surround objects (e.g., icons, texts, etc.) on a wallpaper may be changed, the colors of the objects are important factors that need to be considered in order to ensure visibility of the objects in any environment.
Color analysis of multimedia images and videos is often used in order to determine a color palette for a display device, and also to analyze the color frequency and determine a highlight color. In the field of image processing, the color analysis has been studied for a variety of purposes, such as content matching, image quality improvement, object detection, background separation, and comic effect filtering.
Detection of a representative color of a color image is the basis of the above-mentioned color analysis, and a variety of applications of such an analysis. In order to detect a representative color, input colors are quantized to determine the representative color on the basis of the high-frequency value (i.e., a frequency at which a color appears in the image). As a result, the representative color detection is dependent on the quantization technique and the frequency of each color. In performing representative color detection, various segmentation algorithms including the uniform/non-uniform quantization and the mean shift algorithm can be used, and the performance of each technique is determined by the operation speed, the current consumption, and whether a representative color suitable for a particular purpose is detected.
Existing UIs that operate in the color environment may not provide a high-level of visibility for the user at all times, since existing UIs utilize a single color (i.e., a fixed color) for certain objects, without considering the colors of the surrounding environment. Even when a conventional UI is designed to be displayed using two or more colors for objects, if the basic color (i.e., the default color) is similar to the color of the wallpaper, the visibility of the objects using the basic color may still be low.
FIGS. 17A and 17B are diagrams illustrating a change in visibility of an icon text due to the change of the wallpaper in a conventional electronic device
Referring to FIGS. 17A and 17B, if a color of an icon text 1700 is white, the visibility of the icon text 1700 in FIG. 17B, in which the wallpaper of the electronic device is set to white, may be extremely lower than the visibility of the same icon text 1700 in FIG. 17A in which the wallpaper is set to black.
To change the color of an object (e.g., an icon, a text or the like) displayed on the screen, a representative color detection technique is used, in order to adjust for scenarios in which the color of the wallpaper is changed. To this end, it is necessary to determine a color palette. For example, even a color palette in RGB565 format corresponding to a lower-quality input image may have more than 60,000 colors. It is inefficient to determine the representative color from among a large plurality of candidates. Further, in certain electronic devices, such as a mobile terminal, there can be many constraints on power consumption and operation speed, there is a need to reduce the amount of computation by minimizing the number of candidates used for detection of the representative color. Therefore, in order to perform representative color detection, there is a need for a way to determine a relatively small number of color palettes by quantizing a given color space.
Korean Patent Application No. 10-2011-7000890 refers to a method for determining a representative color of a local red-green-blue (RGB) input using the mean shift algorithm, but this form of determination has a low execution speed and a high current consumption, due to the repetitive execution of the algorithm and the setting of a plurality of candidates.
Korean Patent Application No. 10-2003-0054731 refers to a method for determining a color palette by uniformly quantizing the RGB color space, so Korean Patent Application No. 10-2003-0054731 does not provide any disclosure that can be interpreted as determining the cognitive representative color candidates. The RGB color space can be expressed in the form of a three-dimensional (3D) cubic, as shown in FIGS. 18A and 18B, and each section of the cube is ambiguous in terms of color boundaries. FIG. 18A illustrates the RGB color space in the 3D coordinates, and FIG. 18B illustrates the RGB color space in the plane coordinates. Referring to FIGS. 18A and 18B, distribution of colors may not be linear in the RGB color space. In particular, since the gray is unevenly distributed in the RGB color space, uniform quantization is not suitable for determining the color palette with respect to the RGB color space.
Korean Patent Registration No. 0849847 and Korean Patent Publication No. 1999-0086431 refers to a method for analyzing the representative color through conversion into the commission on illumination (CIE) LCH color space consisting of lightness and color, or the hue/saturation/value (HSV) color space consisting of hue, saturation and value, in order to overcome the shortcomings arising from the nonlinear nature of the RGB color space. By converting a color of an input image into a specific format, and then creating a histogram for the converted value, the most frequent color may be determined as a main color (i.e., a representative color).
However, there are limits in detecting a valid representative color, since these methods consider only the pixel values of the input image in determining the representative color. Further, since performance of quantization is based on the execution speed, the memory capacity and the power state are not considered, use of the above-described methods in an electronic device having significant hardware constraints, such as a smartphone, may cause the current consumption issues by increasing the central processing unit (CPU) clock. Further, these methods may not be suitable scenarios in which the real-time detection is required for a high-resolution input image, such as an ultra high definition (UHD) image.
FIGS. 19A and 19B illustrate a variety of conventional color palettes. FIG. 19A illustrates regular RGB palettes, and FIG. 19B illustrates non-regular RGB palettes. Referring to FIGS. 19A and 19B, color combinations such as a 16-color (4-bit) combination and a 64-color (6-bit) combination are defined based on the 8-color (3-bit) combination. Since such color palettes are defined for the color representation of a display device, the color palettes are not effective for the purpose of detecting the representative color of multimedia content. For example, in a selfie image captured using a smartphone, a skin color may be detected at high frequency, but the existing color palette may not include incarnadine which is one of the skin colors. Therefore, the color palette that is defined in the prior art and that does not consider the cognitive characteristics of the color of the object may not be suitable for detecting the representative color.